﻿
@{
    Layout = "~/Views/Shared/_LayoutHome.cshtml";
}
@model Yyyg.WebUI.Models.SearchResultVM
<div class="sch">
    <div class="path-navs">
        <a href="/">首页</a>
        <a href="javascript:void(0)">搜索结果</a>
    </div>
    <div class="toptitle">
        <span class="big"><b>"@Model.KeyWord"</b>的搜索结果</span>
        <span class="sm">(共<span class="number">@Model.Result.Length</span>件相关商品)</span>
    </div>
    @if (Model.Result.Length > 0)
    {
        <div class="gd-area">
            <div class="tbox">
                <h3 class="title">搜索结果</h3>
                <a class="more" href="#"><span>更多商品,点击查看>></span> </a>
            </div>
            <div class="gd-list gd-list-c5">
                @for (int i = 0; i < Model.Result.Length; i++)
                {
                    var v = Model.Result[i];
                    <div class="gd-item" data-rhid="@v.Id" data-rem="@v.Rem">
                        <a href="/Home/GoodAbout?rhid=@v.Id"><img title="点击查看商品详情" class="gdimg" src="@v.Goods.GetMainImgPath()" /></a>
                        <p class="blkfont gtitle"><a href="/Home/GoodAbout?rhid=@v.Id">@v.Goods.Title</a></p>
                        <div class="bars">
                            <p class="minfont">总需：<span>@v.All_told</span> 人次</p>
                            <div class="progbar">
                                <span style="width:@(v.NowPercentage()+"%")" class="value"></span>
                            </div>
                            <div class="datas">
                                <div class="nums blkfont">
                                    <span>@(v.All_told-v.Rem)</span>
                                    <span>@v.Rem</span>
                                </div>
                                <div class="txs">
                                    <span>已参与人次</span>
                                    <span>剩余人次</span>
                                </div>
                            </div>
                            <div></div>
                            <div></div>
                        </div>
                        <div class="btns">
                            <button title="立即一元云购" class="bynow">立即一元云购</button>
                            <button title="添加到购物车" class="addcar iconfont icon-tianjiadaogouwuche"></button>
                        </div>
                        <div data-gid="@v.Goods.Gid" class="favorite" title="收藏/取消收藏">
                            <i class="layui-icon layui-icon-star"></i>
                        </div>
                    </div>
                }
            </div>
        </div>
    }
    else
    {
        <div class="nohave" text="再怎么找也没有找到诶"></div>
    }
<script>
        $(function () {
             $("#input-search").val("@(Model.KeyWord)");
        })
</script>
</div>
